package net.cloudsun.graph.core;

import java.util.Iterator;
import java.util.List;

/**
 * 有向无环图
 * created at 12/11/2021
 *
 * @author 俞建波
 * <a href="mailto://yujianbo@chtwm.com">yujianbo@chtwm.com</a>
 * @since 1.1.0
 */
public class DirectedAcyclicGraph<E> extends UnweightedGraph<E> implements Iterable<E> {
    public DirectedAcyclicGraph() {
    }

    public DirectedAcyclicGraph(E[] vertices, List<? extends UnweightedEdge>[] edges) {
        super.vertices = vertices;
        super.edges = edges;
    }
    @Override
    public Iterator<E> iterator() {
        return new DagIterator<>(this);
    }
}
